package example

import (
	"go-amis-admin/admin"

	"github.com/gin-gonic/gin"
)

type TodoController struct{}

func (t *TodoController) GetTodoListApi(ctx *admin.AdminContext) {
	var todoList []Todo
	var categoryList []Category
	admin.Instance.DB.Find(&categoryList)
	admin.Instance.DB.Find(&todoList)
	ctx.Sucess(gin.H{"categories": categoryList, "todoList": todoList}, "")
}
